<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\Order */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Orders', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-body">
<div class="widget-header bordered-bottom bordered-blue">
                                            <span class="widget-caption">订单详情</span>
                                        </div>
<table class="table table-bordered table-striped">
                                    <tbody>
                                        <tr>
                                            <td class="text-center">订单编号</td>
                                            <td class="text-center"><?=$model->omun?></td>
                                            <td class="text-center">会员名</td>
                                            <td class="text-center"><?=$model->user->username?></td>
                                            <td class="text-center">订单金额</td>
                                            <td class="text-center"><?=$model->price?>元</td>
                                        </tr>
                                        <tr>
                                            <td class="text-center">收件人</td>
                                            <td class="text-center"><?=$model->name?></td>
                                            <td class="text-center">联系手机</td>
                                            <td class="text-center"><?=$model->tel?></td>
                                            <td class="text-center">联系电话</td>
                                            <td class="text-center"><?=$model->phone?></td>
                                        </tr>
                                        <tr>
                                            <td class="text-center">收件地址</td>
                                            <td class="text-center" colspan="5"><?=$model->pro->name?><?=$model->ci->name?><?=$model->co->name?><?=$model->address?></td>
                                         </tr>
                                        <tr>
                                            <td class="text-center">订单状态</td>
                                            <td class="text-center"><?php switch ($model->status){
                                                    case 0:echo '未付款';break;
                                                    case 1:echo '已付款';break;
                                                    case 2:echo '已发货';break;
                                                    case 3:echo '已收货';break;
                                                }?></td>
                                        	<td class="text-center">快递公司</td>
                                            <td class="text-center"><?=$model->bom->flag?></td>
                                            <td class="text-center">快递单号</td>
                                            <td class="text-center"><?=$model->waybill?></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div class="widget-header bordered-bottom bordered-blue">
                                            <span class="widget-caption">商品信息</span>
                                        </div>
                                        <table class="table table-bordered table-striped">
                                        <th  class="text-center">商品名</th>
                                        <th  class="text-center">单价</th>
                                        <th  class="text-center">数量</th>
                                        <th  class="text-center">合计</th>
                                    <tbody>
                                    <?php if($model->oinfo):?>
                                    <?php foreach($model->oinfo as $val):?>
                                        <tr>
                                            <td class="text-center"><?=$val->name?></td>
                                            <td class="text-center"><?=$val->price?></td>
                                            <td class="text-center"><?=$val->num?>元</td>
                                            <td class="text-center"><?=$val->num*$val->price?>元</td>
                                        </tr>
                                     <?php endforeach;?>
                                     <?php endif;?>
                                    </tbody>
                                </table>
</div>